home *** CD-ROM | disk | FTP | other *** search
- ;
- ; THIS IS A DEMO, YOU WILL NEED TO MODIFY IT FOR YOUR OWN APPLICATION.
- ;
- ; Answer incoming calls if they occur in a specified amount of time.
- ; If a connection is made, enter host mode. If the modem is idle for
- ; the specified time, exit this .CMD file and exit ProComm also.
- ;
- ; This command file makes several assumptions, some of which I'll
- ; surely fail to mention. Most notable is a modem which awknowledges
- ; the Hayes command set. If you are using a 2400 baud modem you will
- ; probably want to un-comment the line immediately after the start label.
- ; Most of the code is attempting to allow different baud rates; if you
- ; will be using a consistent baud rate, you can eliminate much of it.
- ; This script assumes that the modem returns verbose extended result
- ; codes and that ProComm's modem setup is working correctly.
- ; (Use ^Z instead of Goodbye to shutdown the host remotely)
- ;
- ; by d.matthews
- ;
- set databits 8
- set parity none
- set stopbits 1 ; correct line settings
-
- hangup
- transmit "ATS0=1!" ; answer the phone
- pause 2
-
- start:
- ;set baudrate 2400 ; need for 2400b modems
-
- ; !!!set time limit here!!!
- waitfor "^M" 1800 ; give it 30 minutes
-
- if not waitfor ; did it time out ?
- goto exit ; guess so, later...
- endif
-
- rget S1 ; let's make a connection
- find S1 "CONNECT 2400"
- if found
- set baudrate 2400
- else
- find S1 "CONNECT 1200"
- if found
- set baudrate 1200
- else
- find S1 "CONNECT"
- if found
- set baudrate 300
- else
- hangup
- pause 1
- goto start
- endif
- endif
- endif
-
- if connected ; make sure we're connected
- host ; and go into host mode
- else
- hangup ; otherwise
- pause 1 ; hangup
- goto start ; and return
- endif
-
- exit:
- transmit "ATS0=0!" ; don't answer the phone
- quit